
from datetime import datetime
from typing import Union, Any, Optional, List

from pydantic import BaseModel, EmailStr, Field
from sqlalchemy import BigInteger, Boolean, Column, DateTime, ForeignKey, Integer, String
from sqlalchemy.orm import relationship
from sqlalchemy.sql import func
from sqlalchemy.schema import Sequence

from app.common.database import Base
from app.models.base import TableBase, TableBase2

'''
class PayOrder(TableBase2):
    """支付订单表"""
    __tablename__ = "t_pay_order"

    order_no = Column(String(32), primary_key=True, unique=True, index=True)
    order_type = Column(Integer, nullable=False, comment='订单类型')
    pay_type = Column(Integer, nullable=False, comment='支付类型')
    merc_no = Column(String(24), nullable=False, comment='商户编号')
    merc_name = Column(String(32), nullable=False, comment='商户名称')
    factor_no = Column(String(24), nullable=False, comment='代理编号')
    amount = Column(BigInteger, nullable=False, comment='金额')
    fee = Column(BigInteger, nullable=False, comment='费用')
    fee_mode = Column(Integer, comment='计费模式 1.单笔固定 2.百分比')
    status = Column(Integer, nullable=False, comment='状态')
    currency = Column(String(16), comment='币种')
    merc_order_no = Column(String(32), comment='商户订单号(外部订单号)')
    up_chn_order_no = Column(String(32), comment='上游通道订单号')
    up_chn_merc_no = Column(String(24), comment='上游通道订单号')
    product_code = Column(String(24), comment='支付产品编码')
    bank_code = Column(String(8), comment='银行编码')
    card_no = Column(String(24), comment='卡账号')
    card_type = Column(Integer, comment='卡类型 1.借记卡;2.贷记卡')
    account_type = Column(Integer, comment='账户类型 1.对私;2.对公')
    pay_chn_code = Column(String(32), comment='上游通道编码')
    pay_chn_name = Column(String(32), comment='上游通道名称')
    chn_resp_code = Column(String(16), comment='通道返回编码')
    chn_resp_msg = Column(String(64), comment='通道返回信息')
    is_profit_processed = Column(String(1), nullable=False, comment='订单分润是否完成 Y/N')
    #create_time = Column(DateTime, default=func.now(), comment='创建时间')
    #update_time = Column(DateTime, default=func.now(), onupdate=func.now(),  comment='更新时间')
'''
